import {lazy} from "react"

const routes = [
    {
        path:"/index",
        component:lazy(()=>import("../views/Index")),
        children:[
            {
                path:"/index/home",
                component:lazy(()=>import("../views/index/Home")),
                children:[
                    {
                        path:"/index/home/left",
                        component:lazy(()=>import("../views/index/home/Left"))
                    },
                    {
                        path:"/index/home/center",
                        component:lazy(()=>import("../views/index/home/Center"))
                    },
                    {
                        path:"/index/home/right",
                        component:lazy(()=>import("../views/index/home/Right"))
                    },
                    {
                        path:"/index/home",
                        redirect:"/index/home/left"
                    }
                ]
            },
            {
                path:"/index/classify",
                component:lazy(()=>import("../views/index/Classify"))
            },
            {
                path:"/index/shopcar",
                component:lazy(()=>import("../views/index/ShopCar"))
            },
            {
                path:"/index/my",
                component:lazy(()=>import("../views/index/My"))
            },
            {
                path:"/index",
                redirect:"/index/home"
            }
        ]
    },
    {
        path:"/login",
        component:lazy(()=>import("../views/Login"))
    },
    {
        path:"/search",
        component:lazy(()=>import("../views/Search"))
    },
    {
        path:"/detail/:id",
        component:lazy(()=>import("../views/Detail"))
    },
    {
        path:"*",
        component:lazy(()=>import("../views/NotFount"))
    },
    {
        path:"",
        redirect:"/index"
    },
]

export default routes